package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum UserMemberCardActivationState {
	UNWANTED(0,"不需要"),
	NEED(1,"需要"),
	COMPLETED(2,"已完成");
	
	private Integer status;
	
	private String value;

	private UserMemberCardActivationState(Integer status,String value){
		this.status = status;
		this.value = value;
	}

	public int toIntStatus() {
		return this.status;
	}
	
	public String toStringValue() {
		return this.value;
	}

	public static UserMemberCardActivationState toFlag(int status) {
		if (UNWANTED.status == status) {
			return UNWANTED;
		} else if (NEED.status == status) {
			return NEED;
		} else if (COMPLETED.status == status) {
			return COMPLETED;
		}  else {
			throw new InvalidArgumentException("Unknown status[" + status + "].");
		}
	}
}
